<!DOCTYPE html>
<html>

<head>
<title>添加</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">

<%include("/common/include.html"){}%>
<style type="text/css">
	.required{
			display:inline-block;
			width: 93%;
		}
</style>
</head>

<body>
	<div class="easyui-panel" style="width: 100%; height:100%; padding: 30px 60px;">
		<form id="addBaseInfo" method="post" class="form">
		<div style="margin-bottom: 20px">
			<label class="label-top">名称:</label><br>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.name">
			</div>
			<span style="color:red">*必填项</span>
			<input type="hidden" name="baseInfoSet.parentids" value="${baseInfoSet.parentids! }" />
			<input type="hidden" name="baseInfoSet.level" value="${baseInfoSet.level! }" />
			<input type="hidden" name="baseInfoSet.orderid" value="${baseInfoSet.orderid! }" />
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">类型:</label>
			<div class="required">
				<select class="easyui-combobox theme-textbox-radius" name="baseInfoSet.input_type" style="width:100%;">
					<option value="title">项目</option>
					<option value="radio">选项-单选框</option>
					<option value="checkbox">选项-复选框</option>
					<option value="text">选项-文本框</option>
				</select>
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">input_name:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.input_name" type="text" value="${parentInfo.input_name! + baseInfoSet.orderid!}"data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">input_value:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.input_value" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">input_placeholder:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.input_placeholder" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">input_class:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.input_class" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">input_style:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.input_style" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">选项前描述:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.before_span" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top" style="width: 100%; display: block;">选项后描述:</label>
			<div class="required">
				<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="baseInfoSet.after_span" type="text" data-options="prompt:'Enter a email address...'">
			</div>
			<span style="color:red">*必填项</span>
		</div>
		<div style="margin-bottom: 20px">
			<label class="label-top">是否默认值:</label>
			<div class="required">
				<select class="easyui-combobox theme-textbox-radius" name="code.isDefault" labelPosition="top" style="width:100%;">
					<option value="0">否</option>
					<option value="1">是</option>
				</select>
			</div>
			<span style="color:red">*必填项</span>
		</div>
		</form>

	</div>

	<script type="text/javascript">
	//@ sourceURL=mmm.js
				var $form = $('#addBaseInfo');

				var submitNow = function($dialog, $grid, $tree, $pjq) {
					var url = "${cxt!}/baseInfoSet/addBaseInfo";
					$.post(url, sy.serializeObject($form), function(result) {
						if (result.code == '200') {
							var curNode = $tree.getSelectedNodes();
							if (curNode.length>0) {
								curNode[0].isParent = true;
								$tree.reAsyncChildNodes(curNode[0], "refresh");
							}
							$grid.datagrid('reload');
// 							$pjq.messager.alert('提示', "添加成功", 'info');
							$.slideMsg("添加成功！", $pjq);
							$dialog.dialog('destroy');
						} else {
							$.alert($pjq, result.msg);
						}
					}, 'json');
				};
				var submitForm = function($dialog, $grid, $tree, $pjq) {
					submitNow($dialog, $grid, $tree, $pjq);
// 					$form.isValid(function(isValied){
// 						if(isValied){
// 							submitNow($dialog, $grid, $pjq);
// 						}
// 					});
				};

	</script>
</body>
</html>